#Variables

PROJ=rush-jeu
LOGIN=sellem_t

EXES=game

SRC_FOLDER=src
CHECK_PATH=tower

DOC_FILE=doxyfile

ARCHIVE_NAME=$(LOGIN)-$(PROJ)


.PHONY : doc clean distclean

all : $(EXES)

$(EXES) :
	cd $(SRC_FOLDER)/ && make $@

clean :
	cd $(SRC_FOLDER) && make clean
	rm -f *~ *.swp "\#*\#"

distclean : clean
	rm -rf doc bin
	rm -f $(ARCHIVE_NAME).tar.bz2
	cd $(SRC_FOLDER) && make distclean

dist : distclean
	mkdir -p $(ARCHIVE_NAME)
	cp -rf `ls | sed -r 's/\.git|$(ARCHIVE_NAME)(.*)//g'` $(ARCHIVE_NAME)
	tar -cjvf $(ARCHIVE_NAME).tar.bz2 $(ARCHIVE_NAME)/
	rm -rf $(ARCHIVE_NAME)

doc :
	doxygen $(DOC_FILE)

check : all
	cd bin && ./$(CHECK_PATH)
